
(function(window,document,Laya){
	var __un=Laya.un,__uns=Laya.uns,__static=Laya.static,__class=Laya.class,__getset=Laya.getset,__newvec=Laya.__newvec;

	var Box=laya.ui.Box,Button=laya.ui.Button,ColorPickerInput=laya.ide.props.ColorPickerInput,Dialog=laya.ui.Dialog;
	var Event=laya.events.Event,EventDispatcher=laya.events.EventDispatcher,FileManager=laya.ide.managers.FileManager;
	var GameConfig=Laya.GameConfig,Handler=laya.utils.Handler,IDEAPIS=laya.ide.managers.IDEAPIS,IDEEvent=laya.ide.event.IDEEvent;
	var Image=laya.ui.Image,Label=laya.ui.Label,Main=Laya.Main,Node=laya.display.Node,Notice=ide.managers.Notice;
	var PropsInputBase=laya.ide.props.PropsInputBase,PropsInputGroup=laya.ide.props.PropsInputGroup,ResFileManager=laya.ide.managers.ResFileManager;
	var Sprite=laya.display.Sprite,StyleConsts=laya.ide.config.StyleConsts,Text=laya.display.Text,TextInput=laya.ui.TextInput;
	var View=laya.ui.View;
//class laya.ide.props.events.PropEvent extends laya.events.EventDispatcher
var PropEvent=(function(_super){
	function PropEvent(){
		PropEvent.__super.call(this);
	}

	__class(PropEvent,'laya.ide.props.events.PropEvent',_super);
	PropEvent.I=function(){
		return PropEvent.instance=PropEvent.instance||new PropEvent();
	}

	PropEvent.DOUBLE_VALUE="doubleValue";
	PropEvent.PANEL_HEIGHT_CHANGE="panel_height_change";
	PropEvent.TREE_LAYOUT="tree_layout";
	PropEvent.PROP_VALUE_CHANGE="prop_value_change";
	__static(PropEvent,
	['instance',function(){return this.instance=new PropEvent();}
	]);
	return PropEvent;
})(EventDispatcher)


/**
*嵌套数组-创建项PropsInputGroup
*@author CuiXueying
*
*/
//class laya.ide.props.ItemProp extends laya.ui.Image
var ItemProp=(function(_super){
	function ItemProp(varTypes,valueDatas,type){
		/**位置索引**/
		this.index=0;
		this._list=null;
		this._closeBtn=null;
		this._txtName=null;
		this.arrType=null;
		this.varType=[];
		this.valueData={};
		ItemProp.__super.call(this);
		this.varType=varTypes;
		this.valueData=valueDatas;
		this._list=new PropsInputGroup();
		this._list.left=0;
		this._list.right=30;
		this.addChild(this._list);
		this._list.on("PropsInputGroup_ValueChanged",this,this.onValueChange);
		this.arrType=type;
		this.createDeleteBtn();
		if(type!=""){
			this.createText(""+type,90);
		};
		var nodeObj={};
		nodeObj["props"]=varTypes;
		nodeObj["embedType"]=type;
		this._list.config=varTypes;
		this._list.setValueD(valueDatas,null,null,nodeObj);
		this._list.on(/*laya.events.Event.RESIZE*/"resize",this,this.onResizeHeight);
	}

	__class(ItemProp,'laya.ide.props.ItemProp',_super);
	var __proto=ItemProp.prototype;
	__proto.onValueChange=function(key,value,isChanging){
		this.valueData[key]=value;
		this.event("valueChange");
	}

	/**
	*创建key-value 对应文本
	*/
	__proto.createText=function(txt,left){
		this._txtName=new Label();
		this._txtName.left=left;
		this._txtName.fontSize=12;
		this._txtName.color="#FF0000";
		this._txtName.text=txt
		this.addChild(this._txtName);
	}

	/**
	*更新当前容器高度
	*/
	__proto.onResizeHeight=function(height){
		this.height=this._list.height;
		this.event(/*laya.events.Event.RESIZE*/"resize");
	}

	/**
	*创建垃圾桶
	*/
	__proto.createDeleteBtn=function(){
		this._closeBtn=new Button();
		this._closeBtn.skin="play/btn_del.png";
		this._closeBtn.stateNum=2;
		this._closeBtn.scale(0.6,0.6);
		this._closeBtn.right=10;
		this._closeBtn.on(/*laya.events.Event.CLICK*/"click",this,this.onDelete);
		this.addChild(this._closeBtn);
	}

	__proto.onDelete=function(){
		this.removeChildren();
		this.removeSelf();
		this.event("removeGroup",[this.index]);
	}

	return ItemProp;
})(Image)


//class laya.ide.props.ui.props.AddPropsUI extends laya.ide.props.PropsInputBase
var AddPropsUI=(function(_super){
	function AddPropsUI(){
		this.arr_name=null;
		this.btn_arrow=null;
		this.box_content=null;
		this.box_items=null;
		this.box_addprop=null;
		AddPropsUI.__super.call(this);
	}

	__class(AddPropsUI,'laya.ide.props.ui.props.AddPropsUI',_super);
	var __proto=AddPropsUI.prototype;
	__proto.createChildren=function(){
		laya.ui.Component.prototype.createChildren.call(this);
		this.createView(AddPropsUI.uiView);
	}

	AddPropsUI.uiView={"type":"PropsInputBase","props":{"y":0,"x":0,"width":285,"text":"添加属性","listValue":[{"type":"string","name":"11","auto":null},{"type":"bool","name":"0","auto":true}],"height":48,"arrow":true,"arrayName":"array"},"compId":1,"child":[{"type":"Label","props":{"y":1,"x":14,"var":"arr_name","text":"data","listValue":[],"fontSize":12,"color":"#a3a1a1","arrow":true,"align":"center"},"compId":8},{"type":"Clip","props":{"y":2,"x":0,"var":"btn_arrow","skin":"comp/clip_tree.png","index":1,"clipY":2,"arrow":false,"width":11,"height":12},"compId":9},{"type":"Box","props":{"y":24,"var":"box_content","right":0,"listValue":[{"type":"自定义","name":"0","auto":null},{"type":"自定义","name":"1","auto":null},{"type":"自定义","name":"2","auto":null},{"type":"自定义","name":"3","auto":null}],"left":0,"height":22,"arrow":true,"arrType":1},"compId":2,"child":[{"type":"VBox","props":{"y":0,"var":"box_items","right":0,"left":0,"height":0,"arrow":false},"compId":10}],"components":[]},{"type":"Button","props":{"y":2,"var":"box_addprop","stateNum":1,"skin":"view/btn_plus.png","centerX":0.5},"compId":11}],"loadList":["comp/Label.png","comp/clip_tree.png","view/btn_plus.png"],"components":[]};
	return AddPropsUI;
})(PropsInputBase)


//class laya.ide.props.ui.props.AssetsFilterUI extends laya.ide.props.PropsInputBase
var AssetsFilterUI=(function(_super){
	function AssetsFilterUI(){
		this.filter_input=null;
		this.btn_filter=null;
		this.label_filter=null;
		AssetsFilterUI.__super.call(this);
	}

	__class(AssetsFilterUI,'laya.ide.props.ui.props.AssetsFilterUI',_super);
	var __proto=AssetsFilterUI.prototype;
	__proto.createChildren=function(){
		laya.ui.Component.prototype.createChildren.call(this);
		this.createView(AssetsFilterUI.uiView);
	}

	AssetsFilterUI.uiView={"type":"PropsInputBase","props":{"y":0,"width":285,"skin":"comp/input_22.png","height":22,"filter":{"value":"comp/btn_addcomp.png","key":"assets"},"array":[],"sizeGrid":"0,3,0,3","color":"#c5c5c5"},"compId":1,"child":[{"type":"TextInput","props":{"y":1,"x":0,"var":"filter_input","skin":"comp/input_22_selected.png","sizeGrid":"5,5,5,5","right":30,"left":40,"height":20,"arrow":false},"compId":2},{"type":"Button","props":{"y":0,"x":0,"var":"btn_filter","skin":"view/settings2.png","right":4,"name":"btn_filter","scaleX":0.5,"scaleY":0.5},"compId":4},{"type":"Label","props":{"y":0,"x":0,"width":35,"var":"label_filter","valign":"middle","text":"skin","listValue":[],"height":19,"fontSize":12,"color":"#a3a1a1","arrow":true,"align":"left"},"compId":5}],"loadList":["comp/Label.png","comp/btn_addcomp.png","comp/input_22.png","comp/input_22_selected.png","view/settings2.png"],"components":[]};
	return AssetsFilterUI;
})(PropsInputBase)


//class laya.ide.props.ui.props.AssetsArrowUI extends laya.ide.props.PropsInputBase
var AssetsArrowUI=(function(_super){
	function AssetsArrowUI(){
		this.img_bg=null;
		this.txt_url=null;
		this.clip_arrow=null;
		this.img_icon=null;
		this.box_content=null;
		AssetsArrowUI.__super.call(this);
	}

	__class(AssetsArrowUI,'laya.ide.props.ui.props.AssetsArrowUI',_super);
	var __proto=AssetsArrowUI.prototype;
	__proto.createChildren=function(){
		View.regComponent("Text",Text);
		laya.ui.Component.prototype.createChildren.call(this);
		this.createView(AssetsArrowUI.uiView);
	}

	AssetsArrowUI.uiView={"type":"PropsInputBase","props":{"width":264,"height":20},"compId":1,"child":[{"type":"Image","props":{"y":0,"x":0,"width":264,"var":"img_bg","skin":"view/bg_dialog2.png","height":21},"compId":4},{"type":"Text","props":{"y":3,"x":44,"width":84,"var":"txt_url","text":"node","height":16,"color":"#FFFFFF"},"compId":3},{"type":"Clip","props":{"y":4,"x":0,"var":"clip_arrow","skin":"comp/clip_tree.png","name":"clip_arrow","index":1,"clipY":2,"width":11,"height":12},"compId":5},{"type":"Image","props":{"y":2,"x":20,"width":15,"var":"img_icon","skin":"view/logo.png","height":16},"compId":6},{"type":"Box","props":{"y":20,"x":20,"width":245,"var":"box_content","height":20},"compId":8}],"loadList":["comp/clip_tree.png","view/bg_dialog2.png","view/logo.png"],"components":[]};
	return AssetsArrowUI;
})(PropsInputBase)


//class laya.ide.props.ui.props.CreatePropertyViewUI extends laya.ide.props.PropsInputBase
var CreatePropertyViewUI=(function(_super){
	function CreatePropertyViewUI(){
		this.img_bg=null;
		this.nameTf=null;
		this.typeList=null;
		this.box_arraytype=null;
		this.arrayTypeList=null;
		this.addBtn=null;
		this.closeBtn=null;
		CreatePropertyViewUI.__super.call(this);
	}

	__class(CreatePropertyViewUI,'laya.ide.props.ui.props.CreatePropertyViewUI',_super);
	var __proto=CreatePropertyViewUI.prototype;
	__proto.createChildren=function(){
		laya.ui.Component.prototype.createChildren.call(this);
		this.createView(CreatePropertyViewUI.uiView);
	}

	CreatePropertyViewUI.uiView={"type":"PropsInputBase","props":{"width":285,"right":0,"mapc":{"valueList":[],"arrow":true},"label":"添加","height":180,"array":{"valueList":[],"arrow":true}},"compId":1,"child":[{"type":"Image","props":{"y":0,"width":286,"var":"img_bg","skin":"view/bg_uiviewer.png","right":-1,"listValue":[],"left":0,"height":180,"arrow":true,"arrType":0},"compId":2},{"type":"Label","props":{"y":21,"x":20,"width":69,"text":"属性","height":21,"color":"#939090"},"compId":11},{"type":"Label","props":{"y":61,"x":20,"width":69,"text":"类型","height":21,"color":"#AAAAAA","arrow":true},"compId":13},{"type":"TextInput","props":{"y":16,"var":"nameTf","skin":"comp/input_32.png","right":10,"left":80,"height":26,"arrow":false,"sizeGrid":"0,3,0,3","color":"#c5c5c5"},"compId":10},{"type":"ComboBox","props":{"y":56,"var":"typeList","skin":"comp/combo_32.png","sizeGrid":"5,20,5,5","right":10,"listValue":[],"left":80,"height":26,"arrow":true,"labelColors":"#c5c5c5,#c5c5c5,#c5c5c5,#c5c5c5"},"compId":16},{"type":"Box","props":{"y":96,"var":"box_arraytype","right":0,"left":0,"arrow":false},"compId":19,"child":[{"type":"Label","props":{"y":5,"x":20,"width":69,"text":"数组类型","height":21,"color":"#AAAAAA","arrow":false},"compId":17},{"type":"ComboBox","props":{"x":-20,"var":"arrayTypeList","skin":"comp/combo_32.png","sizeGrid":"5,20,5,5","right":10,"listValue":[{"type":"自定义","name":"77","auto":null}],"left":80,"height":26,"arrow":true,"labelColors":"#c5c5c5,#c5c5c5,#c5c5c5,#c5c5c5"},"compId":18}],"components":[]},{"type":"Button","props":{"y":135,"x":30,"var":"addBtn","skin":"comp/button.png","label":"确定","centerX":-70,"arrow":false,"arrType":0,"labelColors":"#efefef,#ffffff,#c5c5c5,#c5c5c5","sizeGrid":"0,4,0,4"},"compId":14},{"type":"Button","props":{"y":135,"x":170,"var":"closeBtn","skin":"comp/button.png","label":"取消","data":[{"type":"number","name":"111","auto":null},{"type":"number","name":"222","auto":null},{"type":"number","name":"333","auto":null},{"type":"number","name":"444","auto":0},{"type":"number","name":"555","auto":null},{"type":"number","name":"666","auto":null},{"type":"number","name":"777","auto":null},{"type":"number","name":"888","auto":null},{"type":"number","name":"999","auto":0},{"type":"number","name":"1010","auto":null},{"type":"number","name":"1122","auto":null},{"type":"number","name":"555","auto":null},{"type":"number","name":"666","auto":null}],"centerX":70,"arrow":false,"labelColors":"#efefef,#ffffff,#c5c5c5,#c5c5c5","sizeGrid":"0,4,0,4"},"compId":15}],"loadList":["comp/Label1.png","comp/button.png","comp/combo_32.png","comp/input_32.png","view/bg_uiviewer.png"],"components":[]};
	return CreatePropertyViewUI;
})(PropsInputBase)


//class laya.ide.props.ui.props.JsonEditorInputUI extends laya.ide.props.PropsInputBase
var JsonEditorInputUI=(function(_super){
	function JsonEditorInputUI(){
		this.titleTxt=null;
		this.pathInputTxt=null;
		this.contentBox=null;
		this.contentTxt=null;
		this.saveBtn=null;
		JsonEditorInputUI.__super.call(this);
	}

	__class(JsonEditorInputUI,'laya.ide.props.ui.props.JsonEditorInputUI',_super);
	var __proto=JsonEditorInputUI.prototype;
	__proto.createChildren=function(){
		View.regComponent("GameConfig",GameConfig);
		View.regComponent("Main",Main);
		laya.ui.Component.prototype.createChildren.call(this);
		this.createView(JsonEditorInputUI.uiView);
	}

	JsonEditorInputUI.uiView={"type":"PropsInputBase","props":{"width":285,"texteditor1":"../../src/Main.as","height":270},"compId":1,"child":[{"type":"Label","props":{"y":8,"x":0,"width":84,"var":"titleTxt","text":"propsName","height":16,"color":"#efc9c9"},"compId":2},{"type":"TextInput","props":{"y":6,"var":"pathInputTxt","text":"TextInput","skin":"comp/input_22.png","right":0,"left":66,"height":22,"sizeGrid":"0,3,0,3","color":"#c5c5c5"},"compId":5},{"type":"Box","props":{"y":38,"var":"contentBox","texteditor1":"../../src/GameConfig.as","right":0,"left":0},"compId":6,"child":[{"type":"TextArea","props":{"x":5,"var":"contentTxt","texteditor1":"../../src/GameConfig.as","text":"content","skin":"comp/textarea.png","right":5,"left":5,"height":192,"extendxx":"22222","editable":true,"color":"#aaaaaa","scrollBarSkin":"comp/vscroll.png","padding":"5,5,5,5","sizeGrid":"5,5,5,5"},"compId":3,"child":[{"type":"Script","props":{"runtime":"GameConfig"},"compId":8},{"type":"Script","props":{"runtime":"Main"},"compId":9},{"type":"Script","props":{"runtime":"GameConfig"},"compId":10}],"components":[]},{"type":"Button","props":{"y":200,"x":5,"var":"saveBtn","texteditor1":"../../src/GameConfig.as","skin":"comp/btn.png","right":5,"label":"Save","labelColors":"#efefef,#ffffff,#c5c5c5,#c5c5c5","sizeGrid":"0,4,0,4"},"compId":4}],"components":[]}],"loadList":["comp/Label.png","comp/btn.png","comp/input_22.png","comp/textarea.png"],"components":[]};
	return JsonEditorInputUI;
})(PropsInputBase)


//class laya.ide.props.LayaMaterialSimple extends laya.ide.props.PropsInputBase
var LayaMaterialSimple=(function(_super){
	function LayaMaterialSimple(){
		this.sizeGrid="5,15,5,5";
		this.albedoLabel=null;
		this.albedoTexture=null;
		this.albedoColor=null;
		this.colorName="albedoColor";
		this.textureName="albedoTexture";
		this.lmatPath=null;
		this.lmatObject=null;
		this.lmatProps=null;
		this._$7_target=null;
		this.filePath=null;
		LayaMaterialSimple.__super.call(this);
		this.height=50;
		this.width=400;
		this.useIDELabel=false;
		this.isFixHeight=false;
		this.albedoLabel=new Label();
		this.albedoLabel.text="Albedo";
		this.albedoLabel.color=StyleConsts.TreeItemColor;
		this.albedoLabel.pos(0,8);
		this.addChild(this.albedoLabel);
		this.albedoTexture=new Image("comp/image.png");
		this.albedoTexture.width=30;
		this.albedoTexture.height=30;
		this.albedoTexture.pos(75,0);
		this.albedoTexture.mouseEnabled=true;
		this.albedoTexture.on("dragDrop",this,this.onDragDrop,["albedoTexture"]);
		this.albedoTexture.on(/*laya.events.Event.MOUSE_DOWN*/"mousedown",this,this.onMouseDown,["albedoTexture"]);
		this.addChild(this.albedoTexture);
		this.albedoColor=new ColorPickerInput();
		this.albedoColor.width=225;
		this.albedoColor.height=25;
		this.albedoColor.pos(160,3);
		this.albedoColor.setColorArr([1,1,1,1]);
		this.albedoColor.on(/*laya.ide.props.ColorPickerInput.COLOR_CHANGED*/"ColorChanged",this,this.onChangeColor,["albedoColor"]);
		this.albedoColor.on(/*laya.ide.props.ColorPickerInput.COLOR_CHANGING*/"COLOR_CHANGING",this,this.onChangeColor,["albedoColor"]);
		this.addChild(this.albedoColor);
	}

	__class(LayaMaterialSimple,'laya.ide.props.LayaMaterialSimple',_super);
	var __proto=LayaMaterialSimple.prototype;
	__proto.onChangeColor=function(type,e){
		var vectors=this.lmatProps.vectors;
		var vector;
		var sendColor;
		for (var j=0;j < vectors.length;j++){
			vector=vectors[j];
			if (vector.name.indexOf(this.colorName)>=0){
				if (type=="albedoColor"){
					sendColor=vector.value=this.albedoColor.getColorArr();
				}
			}
		}
		FileManager.createJSONFile(this.lmatPath,this.lmatObject);
		Notice.notify(/*laya.ide.event.IDEEvent.MATERAILFILE_CHANGED*/"MaterailFile_Changed",[this.filePath]);
	}

	__proto.onDragDrop=function(type,e){
		var path=e._data.asset;
		var texturePath=path.replace('\\','/');
		if (type=="albedoTexture"){
			this.albedoTexture.skin=texturePath;
		};
		var findTexture=false;
		var textures=this.lmatProps.textures;
		var texture;
		for (var i=0;i < textures.length;i++){
			texture=textures[i];
			if (texture.name==this.textureName){
				texture.path=FileManager.getRelativePath(this.lmatPath.substring(0,this.lmatPath.lastIndexOf('/')),path);
				findTexture=true;
			}
		}
		if (!findTexture){
			texture=new Object();
			texture.name=this.textureName;
			texture.path=FileManager.getRelativePath(this.lmatPath.substring(0,this.lmatPath.lastIndexOf('/')),path);
			textures.push(texture);
		}
		FileManager.createJSONFile(this.lmatPath,this.lmatObject);
		Notice.notify(/*laya.ide.event.IDEEvent.MATERAILFILE_CHANGED*/"MaterailFile_Changed",[this.filePath]);
	}

	__proto.onMouseDown=function(type,e){
		var path;
		if (type=="albedoTexture"){
			path=this.albedoTexture.skin;
		}
		path=path.replace('\\','/');
		Notice.notify(/*laya.ide.event.IDEEvent.SELECT_PROJECT_FILE*/"SELECT_Project_FILE",[path]);
	}

	__proto.setTarget=function(target){
		_super.prototype.setTarget.call(this,target);
		this._$7_target=target;
		this.filePath=target.props.material;
		this.lmatPath=ResFileManager.getIDEResPath(this.filePath);
		if (FileManager.exists(this.lmatPath)){
			this.lmatObject=FileManager.readJSONFile(this.lmatPath);
			this.lmatProps=this.lmatObject.props;
			var textures=this.lmatProps.textures;
			var texture;
			for (var i=0;i < textures.length;i++){
				texture=textures[i];
				if (texture.name==this.textureName){
					var albedoTexturePath=FileManager.getPath(this.lmatPath.substring(0,this.lmatPath.lastIndexOf('/')),texture.path);
					this.albedoTexture.skin=albedoTexturePath;
				}
			};
			var vectors=this.lmatProps.vectors;
			var vector;
			for (var j=0;j < vectors.length;j++){
				vector=vectors[j];
				if (vector.name.indexOf(this.colorName)>=0){
					this.albedoColor.setColorArr(vector.value);
				}
			}
		}
	}

	//albedoColor.setTarget(target);
	__proto.initByConfig=function(configO){
		_super.prototype.initByConfig.call(this,configO);
		this.colorName=configO.colorName;
		this.textureName=configO.textureName;
	}

	LayaMaterialSimple.__init$=function(){
		PropsInputBase.regPlugin("MaterialSimple",LayaMaterialSimple);;;;
	}

	return LayaMaterialSimple;
})(PropsInputBase)


//class laya.ide.props.ui.props.AssetsFilterDialogUI extends laya.ui.Dialog
var AssetsFilterDialogUI=(function(_super){
	function AssetsFilterDialogUI(){
		this.img_drag=null;
		this.img_bg=null;
		this.btn_assets=null;
		this.btn_scene=null;
		this.panel_assets=null;
		this.box_assets=null;
		this.panel_scene=null;
		this.box_scene=null;
		this.input_search=null;
		AssetsFilterDialogUI.__super.call(this);
	}

	__class(AssetsFilterDialogUI,'laya.ide.props.ui.props.AssetsFilterDialogUI',_super);
	var __proto=AssetsFilterDialogUI.prototype;
	__proto.createChildren=function(){
		laya.ui.Component.prototype.createChildren.call(this);
		this.createView(AssetsFilterDialogUI.uiView);
	}

	AssetsFilterDialogUI.uiView={"type":"Dialog","props":{"y":0,"x":0,"width":270,"text":"view/logo.png","label":"Aseets","height":330,"filter":{"value":"None","key":"assets"},"arrow":false,"array":[]},"compId":1,"child":[{"type":"Image","props":{"y":0,"x":0,"width":270,"var":"img_drag","top":0,"skin":"comp/input_22.png","sizeGrid":"5,5,5,5","right":0,"name":"img_drag","left":0,"height":301,"color":"#c5c5c5","bottom":0},"compId":7},{"type":"Image","props":{"width":260,"var":"img_bg","top":23,"skin":"view/bg_dialog2.png","right":5,"name":"img_bg","left":5,"height":303,"bottom":4},"compId":12},{"type":"Button","props":{"var":"btn_assets","top":52,"skin":"comp/tab.png","name":"btn_assets","left":5,"label":"Aseets","labelColors":"#aaaaaa,#aaaaaa,#aaaaaa"},"compId":4},{"type":"Button","props":{"var":"btn_scene","top":52,"skin":"comp/tab.png","name":"btn_scene","left":74,"label":"Scene","labelColors":"#aaaaaa,#aaaaaa,#aaaaaa"},"compId":6},{"type":"Button","props":{"y":3,"skin":"view/btn_close.png","right":4,"name":"close","scaleX":0.5,"scaleY":0.5},"compId":8},{"type":"Panel","props":{"x":0,"var":"panel_assets","vScrollBarSkin":"comp/vscroll.png","right":5,"name":"panel_assets","left":5,"height":242,"bottom":10},"compId":19,"child":[{"type":"Box","props":{"y":0,"x":0,"width":260,"var":"box_assets","name":"box_assets","height":246},"compId":21}],"components":[]},{"type":"Panel","props":{"var":"panel_scene","vScrollBarSkin":"comp/vscroll.png","right":5,"name":"panel_scene","left":5,"height":242,"bottom":10},"compId":22,"child":[{"type":"Box","props":{"y":0,"x":0,"width":260,"var":"box_scene","name":"box_scene","height":246},"compId":23}],"components":[]},{"type":"TextInput","props":{"var":"input_search","top":25,"skin":"comp/input_24_selected.png","sizeGrid":"5,5,5,5","right":6,"prompt":"搜索","padding":"0,0,0,20","name":"input_search","left":5,"height":22},"compId":26,"child":[{"type":"Clip","props":{"y":0,"x":0,"skin":"view/search.png","clipY":2,"index":1,"scaleX":0.5,"scaleY":0.5},"compId":24}],"components":[]}],"loadList":["comp/input_22.png","comp/input_24_selected.png","comp/tab.png","comp/vscroll.png","view/bg_dialog2.png","view/btn_close.png","view/logo.png","view/search.png"],"components":[]};
	return AssetsFilterDialogUI;
})(Dialog)


/**
*...
*@author ww
*/
//class laya.ide.props.MagicInput extends laya.ide.props.PropsInputBase
var MagicInput=(function(_super){
	function MagicInput(){
		this.input=null;
		this.rec=null;
		this.curValue=null;
		this.isSettingValue=false;
		MagicInput.__super.call(this);
		this.isFixHeight=true;
		this.useIDELabel=true;
		this.input=new TextInput();
		this.input.skin="comp/input_22.png";
		this.input.left=this.input.top=this.input.bottom=0;
		this.input.right=20;
		this.addChild(this.input);
		this.input.on(/*laya.events.Event.ENTER*/"enter",this,this.onInputValueChange);
		this.input.on(/*laya.events.Event.BLUR*/"blur",this,this.onInputValueChange);
		this.input.color="#ff0000";
		this.rec=new Box();
		this.rec.graphics.drawRect(0,0,20,20,"#00ff00");
		this.rec.size(20,20);
		this.rec.right=0;
		this.addChild(this.rec);
		this.rec.on(/*laya.events.Event.MOUSE_DOWN*/"mousedown",this,this.onDoubleClick);
	}

	__class(MagicInput,'laya.ide.props.MagicInput',_super);
	var __proto=MagicInput.prototype;
	__proto.onDoubleClick=function(){
		var preValue=0;
		preValue=parseInt(this.input.text);
		if (preValue){
			this.input.text=preValue *2+"";
			this.onInputValueChange();
		}
	}

	__proto.setTarget=function(target){
		debugger;
		_super.prototype.setTarget.call(this,target);
		this.curValue=target.props[this.valueKey];
		this.freshUI();
	}

	__proto.freshUI=function(){
		this.isSettingValue=true;
		this.input.text=this.curValue;
		this.isSettingValue=false;
	}

	__proto.onInputValueChange=function(){
		if (this.input.text !=this.curValue){
			this.curValue=this.input.text;
			if (this.isSettingValue)return;
			this.target.props[this.valueKey]=this.curValue;
			this.valueChange(this.valueKey,this.curValue,false);
		}
	}

	__proto.initByConfig=function(configO){
		_super.prototype.initByConfig.call(this,configO);
	}

	MagicInput.__init$=function(){
		PropsInputBase.regPlugin("magicinput",MagicInput);;
	}

	return MagicInput;
})(PropsInputBase)


/**
*嵌套数组-注册类
*@author CuiXueying
*<prop name="mapc" arrayType="map" tips="数组" type="mapc" default="" group="常用" />
*/
//class laya.ide.props.Mapc extends laya.ide.props.PropsInputBase
var Mapc=(function(_super){
	function Mapc(){
		this._add=null;
		this._labelName="";
		Mapc.__super.call(this);
		this.isFixHeight=false;
		this.useIDELabel=false;
		this.initData();
	}

	__class(Mapc,'laya.ide.props.Mapc',_super);
	var __proto=Mapc.prototype;
	__proto.initData=function(){
		this._add=new AddProps();
		this._add.on("resizeHeight",this,this.onResizeHeight);
		this._add.on("valueChange",this,this.onValueChange);
		this.addChild(this._add);
		Mapc.addUIArr.push(this._add);
	}

	__proto.onValueChange=function(data,arrowState){
		this.valueChange(this._labelName,data);
		this.valueChange("arrow",arrowState);
	}

	__proto.onResizeHeight=function(height){
		this.height=height;
		this.freshSize();
	}

	__proto.setTarget=function(target){
		_super.prototype.setTarget.call(this,target);
		this._add.resetData(target,target.props[this._labelName]);
	}

	__proto.initByConfig=function(configO){
		_super.prototype.initByConfig.call(this,configO);
		this._labelName=configO.name;
		if(this._add && configO && configO.name){
			this._add.arrayName=configO.name;
			this._add.arr_name.text=configO.name;
		}
		this._add.arrayType=configO.arrayType;
	}

	Mapc.deleteAddProps=function(add){
		if(Mapc.addUIArr.indexOf(add)!=-1){
			Mapc.addUIArr.splice(Mapc.addUIArr.indexOf(add),1);
		}
	}

	Mapc.addUIArr=[];
	Mapc.__init$=function(){
		PropsInputBase.regPlugin("mapc",Mapc);
	}

	return Mapc;
})(PropsInputBase)


//class laya.ide.props.ui.props.AttributeUI extends laya.ide.props.PropsInputBase
var AttributeUI=(function(_super){
	function AttributeUI(){
		AttributeUI.__super.call(this);;
	}

	__class(AttributeUI,'laya.ide.props.ui.props.AttributeUI',_super);
	var __proto=AttributeUI.prototype;
	__proto.createChildren=function(){
		View.regComponent("Scene3DPlayer",d3.Scene3DPlayer);
		View.regComponent("Sprite3DPlayer",d3.Sprite3DPlayer);
		laya.ui.Component.prototype.createChildren.call(this);
		this.createView(AttributeUI.uiView);
	}

	AttributeUI.uiView={"type":"PropsInputBase","props":{"y":0,"x":0,"width":285,"listValue":[],"height":20,"arrow":true},"compId":1,"child":[{"type":"Button","props":{"y":10,"x":43,"skin":"comp/btn.png","label":"添加属性","height":20,"data":[{"type":"number","name":"abc","auto":123,"arrType":""},{"type":"bool","name":"df","auto":false,"arrType":""}],"arrow":true,"labelColors":"#efefef,#ffffff,#c5c5c5,#c5c5c5","sizeGrid":"0,4,0,4"},"compId":2},{"type":"Scene3DPlayer","props":{"preload1":[{"type":"string","name":"0","auto":"z","arrType":"","accept":"res"},{"type":"string","name":"1","auto":"","arrType":"","accept":"res"},{"type":"string","name":"2","auto":"","arrType":"","accept":"res"}],"preload":[{"type":"string","name":"0","auto":"","arrType":"","accept":"res"}],"arrow":true},"compId":4,"child":[{"type":"Sprite3DPlayer","props":{},"compId":3}],"components":[]}],"loadList":["comp/btn.png"],"components":[]};
	return AttributeUI;
})(PropsInputBase)


/**
*嵌套数组-主逻辑类
*@author CuiXueying
*
*/
//class laya.ide.props.AddProps extends laya.ide.props.ui.props.AddPropsUI
var AddProps=(function(_super){
	function AddProps(){
		this._createPropertyView=null;
		/**是否已经重置过初始化信息**/
		this.isSetView=false;
		/**list.config对应数据**/
		this._varTypes=[];
		/**list.setValueD()对应数据**/
		this._valueData={};
		/**设置vbox内每项的位置**/
		this._itemY=0;
		/**数组对应项实例**/
		this.group=null;
		/**嵌套数组的项索引**/
		this._itemIndex=0;
		/**缓存数据类型-下次打开IDE保持关闭状态显示**/
		this._saveData=[];
		/**单项的固定高度**/
		this.listItemHeight=24;
		/**外层数组的类型：有类型-则直接创建项，map-弹框选择后创建项**/
		this._nowType=null;
		/**嵌套数组的类型：有类型-则直接创建项，自定义-弹框选择后创建项**/
		this._embedType=null;
		/**组件类型**/
		this._arrayType="";
		/**组件名字**/
		this._arrayName="";
		/**数组的展开 或 折叠状态**/
		this._arrowState=false;
		AddProps.__super.call(this);
		this.box_addprop.on("click",this,this.onAddProp);
		this.btn_arrow.on("click",this,this.onArrowClick);
		this.btn_arrow.scale(1,1);
	}

	__class(AddProps,'laya.ide.props.AddProps',_super);
	var __proto=AddProps.prototype;
	/**
	*类型选择弹框-类型改变
	*/
	__proto.onChangeType=function(){
		this._createPropertyView.onChangeType();
		this.height=this.listItemHeight+this.box_items.height+this._createPropertyView.height;
		this.event("resizeHeight",[this.height]);
	}

	/**
	*添加节点
	*/
	__proto.onAddProp=function(){
		console.log(this._embedType);
		if(this._arrayType){
			if(this._arrayType=="map"){
				this.onAddByDia(null);
			}
			else{
				if(this._nowType=="自定义"){
					this.onAddByDia(null);
				}
				else{
					this.addVar({name:this._itemIndex+"",type:this._nowType},"");
				}
			}
		}
		else{
			if(this._embedType=="自定义"){
				this.onAddByDia(null);
			}
			else{
				this.addVar({name:this._itemIndex+"",type:this._embedType},"");
			}
		}
		this.event("resizeHeight",[this.height]);
	}

	/**
	*弹出-类型选择弹框
	*/
	__proto.onAddByDia=function(data){
		if(this._arrayType=="map"){
			this._createPropertyView=new CreatePropertyView(["string","bool","node","mapc","number","res"]);
		}
		else{
			this._createPropertyView=new CreatePropertyView(["string","bool","node","number","res","自定义"]);
		}
		this.box_addprop.disabled=true;
		this._createPropertyView.typeList.on("change",this,this.onChangeType);
		this.addChild(this._createPropertyView);
		this._createPropertyView.showByData(this.addVar.bind(this));
		this._createPropertyView.hideByData(this.hideCreatePro.bind(this));
		this.height=this.listItemHeight+this.box_items.height+this._createPropertyView.height;
		this._createPropertyView.y=this.height-this._createPropertyView.height;
	}

	/**
	*添加数据
	*/
	__proto.addVar=function(data,arrType){
		this.box_addprop.disabled=false;
		var name=data.name;
		if(!name){
			return;
		}
		if(data.auto){
			this._valueData[data.name]=data.auto;
		}
		else{
			switch(data.type){
				case "number":
					this._valueData[data.name]=0;
					break ;
				case "res":
					data.type="string";
					data.accept="res";
					this._valueData[data.name]="";
					break ;
				case "string":
					this._valueData[data.name]="";
					break ;
				default :
					if(data.accept)this._valueData[data.name]="";
					else this._valueData[data.name]=null;
					break ;
				}
		}
		this._varTypes.push(data);
		if(data.type=="mapc")
			this.group=new ItemProp(this._varTypes,this._valueData,arrType);
		else
		this.group=new ItemProp(this._varTypes,this._valueData,"");
		this.group.left=this.group.right=0;
		this.group.y=this._itemY;
		this.group.height=this.listItemHeight;
		this.box_items.addChild(this.group);
		this.group.on("removeGroup",this,this.onRemoveGroup);
		this.group.on("valueChange",this,this.onValueChange);
		this._itemY+=this.listItemHeight;
		this._varTypes=[];
		this._valueData={};
		this.height=this.box_items.height+this.listItemHeight;
		this.event("resizeHeight",[this.height]);
		this.box_items.on("resize",this,this.onResizeItem,["add"]);
		this._itemIndex++;
		this.save();
	}

	__proto.onValueChange=function(){
		this.save();
	}

	/**
	*点击箭头（设置折叠状态）
	*/
	__proto.onArrowClick=function(){
		if(this.btn_arrow.index==0)this.setState(true);
		else this.setState(false);
	}

	/**
	*隐藏选择属性面板
	*/
	__proto.hideCreatePro=function(){
		this.box_addprop.disabled=false;
		this.height=this.listItemHeight+this.box_items.height;
		this.event("resizeHeight",[this.height]);
	}

	/**
	*移除节点
	*/
	__proto.onRemoveGroup=function(){
		this.box_items.on("resize",this,this.onResizeItem,["remove"]);
		this.save();
	}

	/**
	*缓存数据，下次打开保持关闭时状态(增加-删除-值改变时出发)
	*/
	__proto.save=function(){
		this._saveData=[];
		for(var i=0;i<this.box_items.numChildren;i++){
			var item=(this.box_items.getChildAt(i));
			var varType=item.varType[0];
			var valueData=item.valueData;
			var arrType=item.arrType;
			if(varType["accept"])
				this._saveData.push({name:varType.name,type:varType.type,accept:varType["accept"],auto:valueData[varType.name],arrType:arrType});
			else
			this._saveData.push({name:varType.name,type:varType.type,auto:valueData[varType.name],arrType:arrType});
		}
		this.event("valueChange",[this._saveData,this._arrowState]);
	}

	/**
	*设置折叠-展开状态
	*/
	__proto.setState=function(hasContent){
		if (hasContent){
			this.btn_arrow.index=1;
			this.box_content.visible=true;
			this.height=this.box_items.height+this.listItemHeight;
			this._arrowState=true;
		}
		else{
			if(this._createPropertyView){
				this.box_addprop.disabled=false;
				this._createPropertyView.removeChildren();
				this._createPropertyView.removeSelf();
				this._createPropertyView=null;
			}
			this.btn_arrow.index=0;
			this.box_content.visible=false;
			this.height=24;
			this._arrowState=false;
		}
		this.save();
		this.event("resizeHeight",[this.height]);
	}

	/**
	*监听-vbox增加删除节点
	*/
	__proto.onResizeItem=function(type){
		var tempHeight=NaN;
		if(type=="remove"){
			if(this.contains(this._createPropertyView)){
				tempHeight=this.box_items.height+this.listItemHeight+this._createPropertyView.height;
				this._createPropertyView.y=tempHeight-this._createPropertyView.height;
			}
			else{
				tempHeight=this.box_items.height+this.listItemHeight;
			}
		}
		else if(type=="add"){
			tempHeight=this.box_items.height+this.listItemHeight;
		}
		if(this.btn_arrow.index==0){
			this.event("resizeHeight",[24]);
		}
		else{
			this.event("resizeHeight",[tempHeight]);
		}
	}

	/**
	*重置初始化信息-IDE刷新打开，显示之前关闭时的状态
	*/
	__proto.resetData=function(target,data){
		if(!this.isSetView){
			if(target["embedType"]){
				this._embedType=target["embedType"];
			}
			debugger;
			if(data){
				this.isSetView=true;
				if(target.props["arrow"])
					this.setState(target.props["arrow"]);
				else
				this.setState(false);
				if(data){
					var listV=data;
					for(var i=0;i<listV.length;i++){
						if(listV[i].type=="mapc")this.addVar(listV[i],listV[i].arrType);
						else this.addVar(listV[i],"");
					}
				}
				else{
					return;
				}
			}
			else{
				this.setState(false);
				return;
			}
		}
	}

	__getset(0,__proto,'arrayType',null,function(value){
		this._arrayType=value;
		if(value !="map"){
			this._nowType=value;
		}
	});

	__getset(0,__proto,'arrayName',null,function(value){
		this._arrayName=value;
	});

	AddProps.ARRAYTYPE_MAP="map";
	return AddProps;
})(AddPropsUI)


/**
*资源选择器
*/
//class laya.ide.props.AssetsFilter extends laya.ide.props.ui.props.AssetsFilterUI
var AssetsFilter=(function(_super){
	function AssetsFilter(){
		this.assetsFilterDialog=null;
		this._isInitOnce=false;
		this.oldItem=null;
		this.sceneItemNum=0;
		this.assetsItemNum=0;
		/**资源类型：skin：png.jpg node：scene节点 ““：不做筛选**/
		this.assetsType="";
		AssetsFilter.__super.call(this);
		this.isFixHeight=false;
		this.useIDELabel=false;
		this.filter_input.editable=false;
		this.btn_filter.on(/*laya.events.Event.CLICK*/"click",this,this.onFilterClick);
	}

	__class(AssetsFilter,'laya.ide.props.AssetsFilter',_super);
	var __proto=AssetsFilter.prototype;
	__proto.onValueChange=function(key,value){
		var sceneName=IDEAPIS.getDesignData();
		this.valueChange("filter",{key:key,value:value});
	}

	/**
	*打开Assets选择面板
	*/
	__proto.onFilterClick=function(){
		if(this.assetsFilterDialog){
			if(this.assetsFilterDialog.isPopup){
				return;
			}
			else{
				this.assetsFilterDialog.show();
				this.assetsFilterDialog.initData();
			}
		}
		else{
			this.assetsFilterDialog=new AssetsFilterDialog(this.assetsType);
			this.assetsFilterDialog.show();
			PropEvent.I().on(PropEvent.DOUBLE_VALUE,this,this.onConfirm);
			PropEvent.I().on(PropEvent.PROP_VALUE_CHANGE,this,this.onValueChange);
		}
	}

	__proto.onCloseDialog=function(){
		PropEvent.I().off(PropEvent.DOUBLE_VALUE,this,this.onConfirm);
		PropEvent.I().off(PropEvent.PROP_VALUE_CHANGE,this,this.onValueChange);
	}

	/**
	*选中资源
	*/
	__proto.onConfirm=function(value){
		this.filter_input.text=value;
	}

	/**
	*获取IDE XML节点信息
	*/
	__proto.setTarget=function(target){
		laya.ide.props.PropsInputBase.prototype.setTarget.call(this,target);
		if(!this._isInitOnce){
			this._isInitOnce=true;
			if(target.props["filter"]){
				var obj=target.props["filter"];
				if(obj.key=="scene"){
					this.filter_input.text=obj.value.key;
					this.label_filter.text=obj.key;
				}
				else if(obj.key=="assets"){
					this.filter_input.text=obj.value;
					this.label_filter.text=obj.key;
				}
			}
			else{
				this.filter_input.text="";
				this.label_filter.text="skin";
			}
		}
	}

	/**
	*获取并设置缓存数据
	*/
	__proto.initByConfig=function(configO){
		laya.ide.props.PropsInputBase.prototype.initByConfig.call(this,configO);
	}

	AssetsFilter.I=function(){
		return AssetsFilter.single=AssetsFilter.single||new AssetsFilter();
	}

	__static(AssetsFilter,
	['single',function(){return this.single=new AssetsFilter();}
	]);
	AssetsFilter.__init$=function(){
		PropsInputBase.regPlugin("assetsfilter",AssetsFilter);
	}

	return AssetsFilter;
})(AssetsFilterUI)


//class laya.ide.props.AssetsItem extends laya.ide.props.ui.props.AssetsArrowUI
var AssetsItem=(function(_super){
	function AssetsItem(label,node,skinType,arrowVis){
		/**资源的string显示**/
		this.label="";
		/**node的标识符**/
		this.node="";
		this.compId="";
		this.scheight=0;
		this.asheight=0;
		this.state=false;
		this._oldItem=null;
		this.index=0;
		this.sceneData=null;
		this.sceneArr=[];
		this.assetsArr=[];
		/**折叠or展开状态**/
		this.itemState=true;
		/**是否包含符合要求的资源**/
		this._isReg=false;
		this.skins=null;
		this._itemNum=0;
		(skinType===void 0)&& (skinType="");
		AssetsItem.__super.call(this);
		this.txt_url.text=label;
		this.label=label;
		this.node="@node:"+node;
		this.skins=skinType;
		this.compId=node;
		this.clip_arrow.visible=arrowVis;
		if(skinType==""&&node==""){
			this.img_icon.skin="";
			this.txt_url.x=20;
		}
		else if(skinType!=""&&node==""){
			if(Laya.loader.getRes(skinType))
				this.img_icon.skin=skinType;
			else
			this.img_icon.skin="comp/image.png";
		}
		else if(skinType!=""&&node!=""){
			this.img_icon.skin=laya.editor.manager.UIConfigManager.getCompTreeIcon(skinType);
		}
		this.clip_arrow.on(/*laya.events.Event.CLICK*/"click",this,this.onArrowState);
	}

	__class(AssetsItem,'laya.ide.props.AssetsItem',_super);
	var __proto=AssetsItem.prototype;
	__proto.onArrowState=function(){
		this._itemNum=0;
		if(this.state){
			this.state=false;
			this.box_content.visible=true;
			this.clip_arrow.index=1;
			this.setItemState(true);
			this.getHeight(this.box_content);
			PropEvent.I().event(PropEvent.PANEL_HEIGHT_CHANGE,[true,this._itemNum*20]);
			PropEvent.I().event(PropEvent.TREE_LAYOUT,[true,this.index,this._itemNum*20]);
		}
		else{
			this.state=true;
			this.box_content.visible=false;
			this.clip_arrow.index=0;
			this.setItemState(false);
			this.getHeight(this.box_content);
			PropEvent.I().event(PropEvent.PANEL_HEIGHT_CHANGE,[false,this._itemNum*20]);
			PropEvent.I().event(PropEvent.TREE_LAYOUT,[false,this.index,this._itemNum*20]);
		}
	}

	__proto.getHeight=function(boxContent){
		var i=0;
		for(i=0;i<boxContent.numChildren;i++){
			var item=boxContent.getChildAt(i);
			var childBox=item.box_content;
			if(childBox.numChildren==0){
				this._itemNum++;
			}
			else if(childBox.numChildren>0){
				var childItem=childBox.getChildAt(0);
				if(childItem.itemState==false){
					this._itemNum++;
				}
				else{
					this._itemNum++;
					this.getHeight(childBox);
				}
			}
		}
	}

	__proto.setItemState=function(type){
		for(var i=0;i<this.box_content.numChildren;i++){
			var item=this.box_content.getChildAt(i);
			item.itemState=type;
		}
	}

	/**
	*递归节点数据
	*/
	__proto.diguiScene=function(childs,panel){
		if(childs.length>0)
			this.clip_arrow.visible=true;
		else
		this.clip_arrow.visible=false;
		for(var i=0,sz=childs.length;i<sz;i++){
			var obj=childs[i];
			var item=new AssetsItem(obj.label,obj.compId,obj.type);
			this.sceneArr.push(item);
			item.index=AssetsFilter.I().sceneItemNum++;
			item.diguiScene(obj.child);
			this.sceneData=obj;
			item.y=this.box_content.height=this.scheight;
			this.scheight+=item.height;
			this.box_content.addChild(item);
			item.on(/*laya.events.Event.DOUBLE_CLICK*/"doubleclick",this,this.onItemDoubleClick,["scene",item]);
			item.on(/*laya.events.Event.CLICK*/"click",this,this.onClickItem,[item]);
		}
		this.height+=this.scheight;
		this.box_content.event("resize");
	}

	/**
	*递归显示与隐藏子节点
	*@param isShow true 显示；false 隐藏
	*@param data asssetsItem 的sceneData数据
	*@param changeHeight 改变的高度
	*/
	__proto.diguiChangeHeight=function(type,isShow,dataIndex,changeHeight){
		var index=0;
		var arr=[];
		if(type=="assets")
			arr=this.assetsArr;
		else
		arr=this.sceneArr;
		for(var i=0,sz=arr.length;i<sz;i++){
			var item=arr[i];
			if(item.index>dataIndex){
				if(isShow)
					item.y+=changeHeight;
				else
				item.y-=changeHeight;
			}
			else{
				item.diguiChangeHeight(type,isShow,dataIndex,changeHeight);
			}
		}
	}

	/**
	*递归资源数据
	*/
	__proto.diguiAssets=function(rootChild,reg){
		if(rootChild.hasChild){
			for(var i=0,sz=rootChild.childs.length;i<sz;i++){
				var obj=rootChild.childs[i];
				var relativeUrl=FileManager.getRelativePath(IDEAPIS.assetsPath,obj.path);
				if(reg){
					this._isReg=false;
					if(relativeUrl.match(reg)){
						this.addAssetsItem(obj,relativeUrl,reg,true);
					}
					else{
						if(relativeUrl.indexOf(".")==-1){
							if(this.checkOfReg(obj,reg))
								this.addAssetsItem(obj,relativeUrl,reg,false);
						}
					}
				}
				else{
					if(relativeUrl.indexOf(".")==-1)
						this.addAssetsItem(obj,relativeUrl,reg,false);
					else
					this.addAssetsItem(obj,relativeUrl,reg,true);
				}
			}
			this.height+=this.asheight;
			this.txt_url.x=20;
			this.img_icon.visible=false;
			this.clip_arrow.visible=true;
		}
		else{
			if(rootChild.childs){
				this.img_icon.visible=false;
				this.clip_arrow.visible=true;
				this.txt_url.x=20;
			}
			else{
				this.img_icon.visible=true;
				this.clip_arrow.visible=false;
			}
		}
	}

	/**
	*检测该文件夹下是否有符合要求的资源=================================
	*/
	__proto.checkOfReg=function(obj,reg){
		var childs=obj.childs;
		if(childs){
			for(var i=0;i<childs.length;i++){
				if(childs[i].path.match(reg)){
					this._isReg=true;
				}
				else
				this.checkOfReg(childs[i],reg);
			}
		}
		return this._isReg;
	}

	__proto.addAssetsItem=function(obj,relativeUrl,reg,isDouble){
		var item=new AssetsItem(obj.label,"",relativeUrl,true);
		item.index=AssetsFilter.I().assetsItemNum++;
		this.assetsArr.push(item);
		item.diguiAssets(obj,reg);
		item.y=this.asheight;
		this.asheight+=item.height;
		this.box_content.addChild(item);
		item.on(/*laya.events.Event.CLICK*/"click",this,this.onClickItem,[item]);
		if(isDouble){
			item.on(/*laya.events.Event.DOUBLE_CLICK*/"doubleclick",this,this.onItemDoubleClick,["assets",item]);
		}
	}

	__proto.des=function(){
		this.removeChildren();
		this.removeSelf();
	}

	/**
	*设置点击项的皮肤
	*/
	__proto.onClickItem=function(item,e){
		e.stopPropagation();
		this.changeSkin(item);
	}

	__proto.onItemDoubleClick=function(type,item,e){
		e.stopPropagation();
		Dialog.closeAll();
		if(type=="assets")
			this.confirmData("assets",item);
		else
		this.confirmData("scene",item);
	}

	/**
	*双击项-选中
	*/
	__proto.confirmData=function(type,thisItem){
		var skinUrl=thisItem.skins;
		var node=thisItem.node;
		PropEvent.I().event(PropEvent.DOUBLE_VALUE,[skinUrl]);
		if(type=="assets")
			PropEvent.I().event(PropEvent.PROP_VALUE_CHANGE,["assets",skinUrl]);
		else if(type=="scene")
		PropEvent.I().event(PropEvent.PROP_VALUE_CHANGE,["scene",{key:skinUrl,value:node}]);
	}

	/**
	*设置点击项的皮肤
	*/
	__proto.changeSkin=function(e){
		if(AssetsFilter.I().oldItem){
			AssetsFilter.I().oldItem.img_bg.skin="view/bg_dialog2.png";
		}
		(e).img_bg.skin="comp/input_22.png";
		AssetsFilter.I().oldItem=e;
	}

	return AssetsItem;
})(AssetsArrowUI)


/**
*嵌套数组-弹框-选择项类型
*@author CuiXueying
*
*/
//class laya.ide.props.CreatePropertyView extends laya.ide.props.ui.props.CreatePropertyViewUI
var CreatePropertyView=(function(_super){
	function CreatePropertyView(types){
		this._ok=null;
		this._no=null;
		CreatePropertyView.__super.call(this);
		this.addBtn.on(/*laya.events.Event.CLICK*/"click",this,this.onOk);
		this.closeBtn.on(/*laya.events.Event.CLICK*/"click",this,this.onNo);
		this.box_arraytype.visible=false;
		this.typeList.labels=this.arrayTypeList.labels=types.join(',');
		this.typeList.selectedIndex=this.arrayTypeList.selectedIndex=0;
		this.typeList.visibleNum=8;
		this.left=this.right=0;
		this.onChangeType();
	}

	__class(CreatePropertyView,'laya.ide.props.CreatePropertyView',_super);
	var __proto=CreatePropertyView.prototype;
	__proto.onChangeType=function(){
		if(this.typeList.selectedLabel=="mapc"){
			this.box_arraytype.visible=true;
			this.addBtn.y=this.closeBtn.y=135;
			this.img_bg.height=this.height=180;
		}
		else{
			this.box_arraytype.visible=false;
			this.addBtn.y=this.closeBtn.y=105;
			this.img_bg.height=this.height=150;
		}
	}

	__proto.onNo=function(){
		this._no();
		this.removeChildren();
		this.removeSelf();
	}

	__proto.hideByData=function(no){
		this._no=no;
	}

	__proto.showByData=function(ok){
		this.nameTf.text='';
		this.typeList.selectedIndex=0;
		this._ok=ok;
	}

	__proto.onOk=function(){
		this._ok({name:this.nameTf.text,type:this.typeList.selectedLabel},this.arrayTypeList.selectedLabel);
		this.removeChildren();
		this.removeSelf();
	}

	__proto.initByConfig=function(configO){
		laya.ide.props.PropsInputBase.prototype.initByConfig.call(this,configO);
	}

	__proto.setTarget=function(target){
		laya.ide.props.PropsInputBase.prototype.setTarget.call(this,target);
	}

	return CreatePropertyView;
})(CreatePropertyViewUI)


//class laya.ide.props.AssetsFilterDialog extends laya.ide.props.ui.props.AssetsFilterDialogUI
var AssetsFilterDialog=(function(_super){
	function AssetsFilterDialog(type){
		/**单条项的高度**/
		this.itemHeight=20;
		/**单条项的宽度**/
		this.itemWeight=264;
		/**当前所属面板状态**/
		this.isAssets=false;
		/**scene节点数组**/
		this._itemSceneArr=[];
		/**assets节点数组**/
		this._itemAssetsArr=[];
		/**assets or scene**/
		this._diaState="";
		/**组件类型**/
		this._assetsType="";
		/**skin的后缀名筛选**/
		this.reg=null;
		/**需递归的文件夹路径**/
		this._saveAssetsUrl=[];
		/**是否包含符合要求的资源**/
		this._isReg=false;
		this._sceneHeight=0;
		this._assetsHeight=0;
		AssetsFilterDialog.__super.call(this);
		this._assetsType=type;
		this.img_drag.on(/*laya.events.Event.MOUSE_DOWN*/"mousedown",this,this.onDragDown);
		this.btn_assets.on(/*laya.events.Event.CLICK*/"click",this,this.onClickAssets);
		this.btn_scene.on(/*laya.events.Event.CLICK*/"click",this,this.onClickScene);
		this.input_search.on(/*laya.events.Event.INPUT*/"input",this,this.onSearchChange);
		this.panel_assets.vScrollBar.touchScrollEnable=true;
		this.panel_scene.vScrollBar.touchScrollEnable=true;
		Laya.stage.on(/*laya.events.Event.MOUSE_DOWN*/"mousedown",this,this.onClickStage);
		this.initData();
	}

	__class(AssetsFilterDialog,'laya.ide.props.AssetsFilterDialog',_super);
	var __proto=AssetsFilterDialog.prototype;
	/**
	*初始化信息
	*/
	__proto.initData=function(){
		this.setReg();
		PropEvent.I().on(PropEvent.PANEL_HEIGHT_CHANGE,this,this.resetPanel);
		PropEvent.I().on(PropEvent.TREE_LAYOUT,this,this.diguiChangeHeight);
		this.closeHandler=Handler.create(this,this.onCloseDialog);
	}

	/**
	*搜索功能
	*/
	__proto.onSearchChange=function(){
		this._sceneHeight=0;
		this._assetsHeight=0;
		var txt=this.input_search.text;
		if(this.isAssets)
			this.getAssets(txt);
		else
		this.getScene(txt);
	}

	/**
	*处理-失去焦点时弹框关闭（没有blur事件）
	*/
	__proto.onClickStage=function(e){
		if(e.target.name!=null){
			var name=e.target.name;
			if(name!=null&&name==""){
				if(e.target.parent.name)name=e.target.parent.name;
				if(name!=null&&name==""){
					if(e.target.parent.parent.parent.name)name=e.target.parent.parent.parent.name;
				}
			}
			if(e.target.label&&e.target.label!="")return;
			var nameStr="box_assets,box_scene,panel_assets,panel_scene,img_drag,btn_scene,btn_assets,btn_filter,input_search,clip_arrow";
			if(nameStr.indexOf(name)==-1){
				this.close();
			}
		}
	}

	/**
	*不同资源类型处理
	*/
	__proto.setReg=function(){
		switch(this._assetsType){
			case "skin":
				this.reg=/.*?(png|jpg)/gi;
				this.btn_assets.visible=true;
				this.btn_scene.visible=false;
				this.onClickAssets();
				this.btn_assets.mouseEnabled=false;
				this.btn_assets.selected=false;
				break ;
			case "node":
				this.btn_assets.visible=false;
				this.btn_scene.visible=true;
				this.btn_scene.left=5;
				this.onClickScene();
				this.btn_scene.mouseEnabled=false;
				this.btn_scene.selected=false;
				break ;
			case "":
				this.btn_assets.visible=true;
				this.btn_scene.visible=true;
				this.onClickAssets();
				break ;
			default :{
					break ;
				}
			}
	}

	/**
	*获取节点列表
	*type 搜索条件
	*/
	__proto.getScene=function(type){
		var numChilds=this.box_scene.numChildren;
		if(numChilds>0){
			for(var a=0;a<numChilds;a++){
				(this.box_scene.getChildAt(0)).des();
			}
		};
		var curSceneUrl=IDEAPIS.getCurPagePath();
		var curSceneData=FileManager.readJSONFile(curSceneUrl,true);
		this.foreachScene(curSceneData,true,type);
	}

	/**
	*循环遍历子节点
	*@param curSceneData 当前页面节点信息
	*@param isOnce 是否是第一层遍历
	*@param type 筛选条件
	*/
	__proto.foreachScene=function(curSceneData,isOnce,type){
		(type===void 0)&& (type="");
		if(this.box_scene.numChildren==0){
			this.addItemTiled("None","","","scene",this.box_scene);
			this._sceneHeight+=21;
		};
		var childs=curSceneData.child;
		if(type==""){
			for(var i=0,sz=childs.length;i<sz;i++){
				var obj=childs[i];
				var item=new AssetsItem(obj.label,obj.compId,obj.type);
				this._itemSceneArr.push(item);
				item.index=AssetsFilter.I().sceneItemNum++;
				item.diguiScene(obj.child);
				item.sceneData=obj;
				item.y=this._sceneHeight;
				this._sceneHeight+=item.height;
				this.box_scene.addChild(item);
				item.on(/*laya.events.Event.DOUBLE_CLICK*/"doubleclick",this,this.onItemDoubleClick,["scene",item]);
				item.on(/*laya.events.Event.CLICK*/"click",this,this.onClickItem,[item]);
			}
			this.box_scene.height=AssetsFilter.I().sceneItemNum*this.itemHeight;
		}
		else{
			for(var i=0;i<childs.length;i++){
				var childs01=childs[i].child;
				if(childs[i].label.indexOf(type)!=-1){
					this.addItemTiled(childs[i].label,childs[i].compId,childs[i].type,"scene",this.box_scene);
				}
				if(childs01.length>0)
					this.foreachScene(childs[i],false,type);
			}
		}
		this.box_scene.event("resize");
		this.panel_scene.refresh();
	}

	/**
	*递归显示与隐藏子节点
	*@param isShow true 显示；false 隐藏
	*@param data asssetsItem 的sceneData数据
	*@param changeHeight 改变的高度
	*/
	__proto.diguiChangeHeight=function(isShow,dataIndex,changeHeight){
		var index=0;
		var arr=[];
		if(this._diaState=="assets")
			arr=this._itemAssetsArr;
		else
		arr=this._itemSceneArr;
		for(var i=0,sz=arr.length;i<sz;i++){
			var item=arr[i];
			if(item.index>dataIndex){
				if(isShow)
					item.y+=changeHeight;
				else
				item.y-=changeHeight;
			}
			else{
				item.diguiChangeHeight(this._diaState,isShow,dataIndex,changeHeight);
			}
		}
	}

	/**
	*获取资源列表
	*type 搜索条件
	*/
	__proto.getAssets=function(type){
		var numChilds=this.box_assets.numChildren;
		if(numChilds>0){
			for(var a=0;a<numChilds;a++){
				(this.box_assets.getChildAt(0)).des();
			}
		};
		var assetsUrl=IDEAPIS.assetsPath;
		var fileList=laya.ide.devices.FileTools.getFileTreeArr(assetsUrl);
		var allAssets=FileManager.getFileList(assetsUrl);
		if(this.box_assets.numChildren==0){
			this.addItemTiled("None","","","assets",this.box_assets);
			this._assetsHeight+=21;
		}
		if(type==""){
			for(var i=0,sz=fileList.length;i<sz;i++){
				var obj=fileList[i];
				if(this._saveAssetsUrl.length>0){
					if(obj.path.indexOf(this._saveAssetsUrl[this._saveAssetsUrl.length-1])==-1){
						this.checkReg(obj);
					}
				}
				else{
					this.checkReg(obj);
				}
			}
			this.box_assets.height=fileList*this.itemHeight;
		}
		else{
			for(var i=0;i<allAssets.length;i++){
				var url=allAssets[i];
				var relaUrl=FileManager.getRelativePath(IDEAPIS.assetsPath,url);
				var caseRelaUrl=relaUrl.toLowerCase();
				var caseType=type.toLocaleLowerCase();
				if(caseRelaUrl.indexOf(caseType)!=-1){
					if(this.reg){
						if(relaUrl.match(this.reg))
							this.addItemTiled(relaUrl,"",relaUrl,"assets",this.box_assets);
					}
					else{
						this.addItemTiled(relaUrl,"",relaUrl,"assets",this.box_assets);
					}
				}
			}
		}
		this.box_assets.event("resize");
		this.panel_assets.refresh();
	}

	/**
	*检测正则（资源类型筛选）
	*/
	__proto.checkReg=function(obj){
		this._isReg=false;
		this._saveAssetsUrl.push(obj.path);
		var relativeUrl=FileManager.getRelativePath(IDEAPIS.assetsPath,obj.path);
		if(this.reg){
			if(relativeUrl.match(this.reg)){
				this.addAssetsItem(obj,relativeUrl,true);
			}
			else{
				if(relativeUrl.indexOf(".")==-1){
					if(this.checkOfReg(obj))
						this.addAssetsItem(obj,relativeUrl,false);
				}
			}
		}
		else{
			if(relativeUrl.indexOf(".")==-1)
				this.addAssetsItem(obj,relativeUrl,false);
			else
			this.addAssetsItem(obj,relativeUrl,true);
		}
	}

	/**
	*检测该文件夹下是否有符合要求的资源
	*/
	__proto.checkOfReg=function(obj){
		var childs=obj.childs;
		if(childs){
			for(var i=0;i<childs.length;i++){
				if(childs[i].path.match(this.reg)){
					this._isReg=true;
				}
				else
				this.checkOfReg(childs[i]);
			}
		}
		return this._isReg;
	}

	/**
	*平铺结构添加项
	*/
	__proto.addItemTiled=function(relaUrl,node,skin,type,parentBox){
		var item=new AssetsItem(relaUrl,node,skin,false);
		item.y=parentBox.numChildren*this.itemHeight;
		parentBox.addChild(item);
		item.on(/*laya.events.Event.CLICK*/"click",this,this.onClickItem,[item]);
		item.on(/*laya.events.Event.DOUBLE_CLICK*/"doubleclick",this,this.onItemDoubleClick,[type,item]);
	}

	/**
	*树状结构添加项
	*/
	__proto.addAssetsItem=function(obj,relativeUrl,isDouble){
		var item=new AssetsItem(obj.label,"",relativeUrl);
		this._itemAssetsArr.push(item);
		item.index=AssetsFilter.I().assetsItemNum++;
		item.diguiAssets(obj,this.reg);
		item.y=this._assetsHeight;
		this._assetsHeight+=item.height;
		this.box_assets.addChild(item);
		item.on(/*laya.events.Event.CLICK*/"click",this,this.onClickItem,[item]);
		if(isDouble){
			item.on(/*laya.events.Event.DOUBLE_CLICK*/"doubleclick",this,this.onItemDoubleClick,["assets",item]);
		}
	}

	/**
	*重置panel的高度
	*@param isShow 展开 or 折叠
	*@param changeHeight 改变的高度
	*/
	__proto.resetPanel=function(isShow,changeHeight){
		if(this._diaState=="assets"){
			if(isShow)
				this.box_assets.height+=changeHeight;
			else
			this.box_assets.height-=changeHeight;
			this.box_assets.event("resize");
			this.panel_assets.refresh();
		}
		else{
			if(isShow)
				this.box_scene.height+=changeHeight;
			else
			this.box_scene.height-=changeHeight;
			this.box_scene.event("resize");
			this.panel_scene.refresh();
		}
	}

	/**
	*双击项-选中
	*/
	__proto.onItemDoubleClick=function(type,item){
		this.close();
		if(type=="assets"){
			this.confirmData("assets",item);
		}
		else{
			this.confirmData("scene",item);
		}
	}

	/**
	*双击项-选中
	*/
	__proto.confirmData=function(type,thisItem){
		var skinUrl=thisItem.skins;
		var node=thisItem.node;
		PropEvent.I().event(PropEvent.DOUBLE_VALUE,[skinUrl]);
		if(type=="assets")
			PropEvent.I().event(PropEvent.PROP_VALUE_CHANGE,["assets",thisItem.skins]);
		else if(type=="scene")
		PropEvent.I().event(PropEvent.PROP_VALUE_CHANGE,["scene",{key:skinUrl,value:node}]);
	}

	/**
	*设置点击项的皮肤
	*/
	__proto.onClickItem=function(item){
		this.changeSkin(item);
	}

	/**
	*设置点击项的皮肤
	*/
	__proto.changeSkin=function(e){
		if(AssetsFilter.I().oldItem){
			AssetsFilter.I().oldItem.img_bg.skin="view/bg_dialog2.png";
		}
		(e).img_bg.skin="comp/input_22.png";
		AssetsFilter.I().oldItem=e;
	}

	/**
	*点击节点按钮
	*/
	__proto.onClickScene=function(){
		this._sceneHeight=0;
		AssetsFilter.I().sceneItemNum=0;
		this._itemSceneArr=[];
		this._itemSceneArr=[];
		this.input_search.text="";
		this.getScene("");
		this._diaState="scene";
		this.btn_assets.selected=false;
		this.btn_scene.selected=true;
		this.panel_assets.visible=false;
		this.panel_scene.visible=true;
		this.isAssets=false;
	}

	/**
	*点击资源按钮
	*/
	__proto.onClickAssets=function(){
		this._assetsHeight=0;
		AssetsFilter.I().assetsItemNum=0;
		this._itemAssetsArr=[];
		this._saveAssetsUrl=[];
		this.input_search.text="";
		this.getAssets("");
		this._diaState="assets";
		this.btn_assets.selected=true;
		this.btn_scene.selected=false;
		this.panel_assets.visible=true;
		this.panel_scene.visible=false;
		this.isAssets=true;
	}

	/**
	*面板拖拽
	*/
	__proto.onDragDown=function(){
		this.startDrag();
	}

	__proto.onCloseDialog=function(){
		PropEvent.I().off(PropEvent.PANEL_HEIGHT_CHANGE,this,this.resetPanel);
		PropEvent.I().off(PropEvent.TREE_LAYOUT,this,this.diguiChangeHeight);
		AssetsFilter.I().onCloseDialog();
		Laya.stage.off(/*laya.events.Event.MOUSE_DOWN*/"mousedown",this,this.onClickStage);
	}

	return AssetsFilterDialog;
})(AssetsFilterDialogUI)


/**
*...
*@author ww
*/
//class laya.ide.props.JsonEditorInput1 extends laya.ide.props.ui.props.JsonEditorInputUI
var JsonEditorInput1=(function(_super){
	function JsonEditorInput1(){
		this._value=null;
		this._path=null;
		JsonEditorInput1.__super.call(this);
		this.isFixHeight=false;
		this.useIDELabel=false;
		this.contentTxt.on(/*laya.events.Event.ENTER*/"enter",this,this.onTextChange);
		this.contentTxt.on(/*laya.events.Event.BLUR*/"blur",this,this.onTextChange);
		this.saveBtn.on(/*laya.events.Event.CLICK*/"click",this,this.onSaveBtn);
		this.pathInputTxt.on("dragDrop",this,this.onDragDrop);
	}

	__class(JsonEditorInput1,'laya.ide.props.JsonEditorInput1',_super);
	var __proto=JsonEditorInput1.prototype;
	__proto.onSaveBtn=function(){
		this._value=this.contentTxt.text;
		FileManager.createTxtFile(FileManager.getPath(IDEAPIS.assetsPath,this._path),this._value);
		this.saveBtn.visible=false;
	}

	__proto.onDragDrop=function(e){
		var dataO;
		dataO=e.data;
		if (!dataO)return;
		if (!dataO.type=="res")return;
		var asset;
		asset=dataO.asset;
		if (!asset)return;
		var rPath;
		rPath=FileManager.getRelativePath(IDEAPIS.assetsPath,asset);
		this.setPath(rPath);
		this.valueChange(this.valueKey,rPath);
	}

	__proto.setTarget=function(target){
		laya.ide.props.PropsInputBase.prototype.setTarget.call(this,target);
		this.titleTxt.text=this.valueKey;
		this.setPath(target.props[this.valueKey]);
		this.freshUI();
	}

	__proto.setPath=function(path){
		this._path=path;
		this.freshUI();
	}

	__proto.onTextChange=function(){
		if (this.contentTxt !=this._value){
			this.saveBtn.visible=true;
		}
	}

	__proto.freshUI=function(){
		this.pathInputTxt.text=this._path || "";
		if (this._path){
			var filePath;
			filePath=ResFileManager.getIDEResPath(this._path);
			if (FileManager.exists(filePath)){
				this.setState(true);
				this._value=FileManager.readTxtFile(filePath);
				this.contentTxt.text=this._value;
				this.saveBtn.visible=false;
				return;
			}
		}
		this.setState(false);
	}

	__proto.setState=function(hasContent){
		if (hasContent){
			this.contentBox.visible=true;
			this.height=270;
			}else{
			this.contentBox.visible=false;
			this.height=32;
		}
		this.freshSize();
	}

	__proto.initByConfig=function(configO){
		laya.ide.props.PropsInputBase.prototype.initByConfig.call(this,configO);
	}

	JsonEditorInput1.__init$=function(){
		PropsInputBase.regPlugin("texteditor1",JsonEditorInput1);;
	}

	return JsonEditorInput1;
})(JsonEditorInputUI)


//class laya.ide.props.view.props.Attribute extends laya.ide.props.ui.props.AttributeUI
var Attribute=(function(_super){
	function Attribute(){
		this._attribute=[];
		this._createPropertyView=null;
		Attribute.__super.call(this);
	}

	__class(Attribute,'laya.ide.props.view.props.Attribute',_super);
	var __proto=Attribute.prototype;
	// }
	__proto.onVarChange=function(data){
		this.valueChange("data",data);
	}

	__proto.setTarget=function(target){
		laya.ide.props.PropsInputBase.prototype.setTarget.call(this,target);
		var props=target.props.data;
		if(!props){
			this._attribute=[];
			}else{
			this._attribute=props;
		}
	}

	// _createPropertyView && _createPropertyView.resetData(_attribute,onVarChange.bind(this));
	__proto.initByConfig=function(configO){
		laya.ide.props.PropsInputBase.prototype.initByConfig.call(this,configO);
	}

	Attribute.__init$=function(){
		PropsInputBase.regPlugin("attribute",Attribute);
	}

	return Attribute;
})(AttributeUI)


	Laya.__init([AssetsFilter,Mapc,LayaMaterialSimple,MagicInput,Attribute,JsonEditorInput1]);
})(window,document,Laya);

if (typeof define === 'function' && define.amd){
	define('laya.core', ['require', "exports"], function(require, exports) {
        'use strict';
        Object.defineProperty(exports, '__esModule', { value: true });
        for (var i in Laya) {
			var o = Laya[i];
            o && o.__isclass && (exports[i] = o);
        }
    });
}